import {RouteRecordRaw} from "vue-router";

/*
 * 静态路由
 */

const staticRoutes: Array<RouteRecordRaw> = [
    {
        path: '/login',
        component: () => import('../pages/login.vue'),
        name: 'Login',
        //组件名称
        meta: {
            title: '登录',
            isAuth: true
        },
    },
    {
        path: '/',
        name: 'main',
        redirect: '/home',
        component: () => import('../pages/main.vue'),
        //组件名称
        meta: {
            title: 'main',
            isAuth: true
        },
        children: [
            {
                path: '/home',
                //路由到的地址(自定义)
                component: () => import('../pages/home.vue'),
                //引入组件，组件Home.vue所在路径
                //Home.vue是需要路由的vue组件
                name: 'Home',
                //组件名称
                meta: {
                    title: '首页',
                    isAuth: true
                },
            },
            {
                path: '/user',
                component: () => import('../pages/user/user.vue'),
                name: 'User',
                meta: {
                    title: '用户管理',
                    isAuth: true
                },
                children: [
                    {
                        path: '/user/userList',
                        component: () => import('../pages/user/userList.vue'),
                        name: 'UserList',
                        meta: {
                            title: '用户信息',
                            isAuth: true
                        },

                    }
                ]
            }
        ]
    }
]
export default staticRoutes
